package com.lz.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import lombok.Data;

@Table
@Data
@Entity
public class OrderSheet implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 853559399668900417L;
	//订单编号
	@Id
	@GeneratedValue(generator = "native")
	@GenericGenerator(name = "native",strategy = "native")
	private Integer orderId;
	//对应员工

	@ManyToOne(targetEntity=Employee.class)
	@JoinColumn(name="employeeId")
	private Employee employee;
	
	//对应客户

	@ManyToOne(targetEntity=Customer.class)
	@JoinColumn(name = "customerId")
	private Customer customer;
	
	//订单备注
	private String orderMsg;
	
	//订单生成日期
	@Temporal(TemporalType.TIMESTAMP)
	private Date orderSheetDate;
	//订单状态
	private String orderState;
	
	//购买车辆

	@OneToOne(targetEntity=Car.class)
	@JoinColumn(name="carId")
	private Car car;
	
	//订单金额
	private int orderMoney;
	

	
	
}
